
             
/**
 * 
 *
 * @File name:  TFaAllocateDao.java 
 * @Create on:  2011-11-15 21:23:595
 * @Author   :  谭翔
 *
 * @ChangeList
 * ---------------------------------------------------
 * Date         Editor              ChangeReasons
 *
 */
           
        package com.boho.estates.usual.dao;

            
import java.sql.Connection;
import java.util.LinkedList;
import java.util.List;

import com.boho.estates.po.TFaAllocatePO;

import cn.boho.framework.po.CQuery;
import cn.boho.framework.po.CQueryFactoryTool;
import cn.boho.framework.po.DAO;
import cn.boho.framework.po.DynaBeanMap;
import cn.boho.framework.po.CQExp;
import cn.boho.framework.po.Pager;
import cn.boho.framework.po.ComboPager;
import cn.boho.framework.utils.DateUtils;
            
        /**
 * 【资产调拨信息:T_FA_ALLOCATE】的Dao操作类
 * 
 */
public class TFaAllocateDao extends DAO {
	/**
	* 查询所有【资产调拨信息:T_FA_ALLOCATE】信息
	* @param con
	* @return
	* @throws Exception
	* @date 2011-11-15
	* @author 谭翔
	*
	*/
	public static List queryTFaAllocate(Connection con)throws Exception{
		List list = new LinkedList();
		StringBuffer sql = new StringBuffer();
		sql.append("select * from T_FA_ALLOCATE");
		CQuery query = CQueryFactoryTool.createFactory().createCQuery();
		query.setCommand(sql.toString());
		list = query.getDynaBeanMapList("T_FA_ALLOCATE", con);
		return list;
	}
	/**
	* 分页查询所有【资产调拨信息:T_FA_ALLOCATE】信息
	* @param con
	* @param pager
	* @return
	* @throws Exception
	* @date 2011-11-15
	* @author 谭翔
	*
	*/
	public static ComboPager queryTFaAllocateByPager(Connection con,Pager pager)throws Exception{
		StringBuffer sql = new StringBuffer();
		sql.append("select * from T_FA_ALLOCATE");
		CQuery query = CQueryFactoryTool.createFactory().createCQuery();
		query.setCommand(sql.toString());
		return query.getDynaBeanMapComboPager("T_FA_ALLOCATE", pager,con);
	}
	/**
	* 根据主键【调拨单号:FA_ALLOCATE_NO|】获得信息
	* @param con
	* @param faAllocateNo 调拨单号
	* @return
	* @throws Exception
	* @date 2011-11-15
	* @author 谭翔
	*
	*/
	public static DynaBeanMap getTFaAllocateByPk(Connection con,java.lang.Integer faAllocateNo)throws Exception{
		DynaBeanMap dynaBeanMap = null;
		StringBuffer sql = new StringBuffer();
		sql.append("select * from T_FA_ALLOCATE where  FA_ALLOCATE_NO=?");
		CQuery query = CQueryFactoryTool.createFactory().createCQuery();
		query.setCommand(sql.toString());
		query.setInt(1,faAllocateNo);
		dynaBeanMap = query.getDynaBeanMap("T_FA_ALLOCATE", con);
		return dynaBeanMap;
	}
	/**
	* 根据主键【调拨单号:FA_ALLOCATE_NO|】获得PO对象
	* @param con
	* @param faAllocateNo 调拨单号
	* @return
	* @throws Exception
	* @date 2011-11-15
	* @author 谭翔
	*
	*/
	public static TFaAllocatePO getTFaAllocatePOByPk(Connection con,java.lang.Integer faAllocateNo)throws Exception{
		DynaBeanMap dynaBeanMap = null;
		StringBuffer sql = new StringBuffer();
		sql.append("select * from T_FA_ALLOCATE where  FA_ALLOCATE_NO=?");
		CQuery query = CQueryFactoryTool.createFactory().createCQuery();
		query.setCommand(sql.toString());
		query.setInt(1,faAllocateNo);
		dynaBeanMap = query.getDynaBeanMap("T_FA_ALLOCATE", con);
		if(dynaBeanMap!=null){
			TFaAllocatePO tFaAllocatePO = new TFaAllocatePO();
			tFaAllocatePO.setFaAllocateNo(dynaBeanMap.get("FA_ALLOCATE_NO")==null?null:(Integer)dynaBeanMap.get("FA_ALLOCATE_NO"));
			tFaAllocatePO.setDepartmentNo(dynaBeanMap.get("DEPARTMENT_NO")==null?null:(Integer)dynaBeanMap.get("DEPARTMENT_NO"));
			tFaAllocatePO.setFaAllocateDate(DateUtils.TimestampToDate(dynaBeanMap.get("FA_ALLOCATE_DATE")));
			tFaAllocatePO.setApplicant(dynaBeanMap.get("APPLICANT")==null?null:(String)dynaBeanMap.get("APPLICANT"));
			tFaAllocatePO.setAllocateOutDepartment(dynaBeanMap.get("ALLOCATE_OUT_DEPARTMENT")==null?null:(String)dynaBeanMap.get("ALLOCATE_OUT_DEPARTMENT"));
			tFaAllocatePO.setOldStoredIn(dynaBeanMap.get("OLD_STORED_IN")==null?null:(String)dynaBeanMap.get("OLD_STORED_IN"));
			tFaAllocatePO.setOutDepartmentManager(dynaBeanMap.get("OUT_DEPARTMENT_MANAGER")==null?null:(String)dynaBeanMap.get("OUT_DEPARTMENT_MANAGER"));
			tFaAllocatePO.setOldWithMananger(dynaBeanMap.get("OLD_WITH_MANANGER")==null?null:(String)dynaBeanMap.get("OLD_WITH_MANANGER"));
			tFaAllocatePO.setAllocateInDepartment(dynaBeanMap.get("ALLOCATE_IN_DEPARTMENT")==null?null:(String)dynaBeanMap.get("ALLOCATE_IN_DEPARTMENT"));
			tFaAllocatePO.setNewStoredIn(dynaBeanMap.get("NEW_STORED_IN")==null?null:(String)dynaBeanMap.get("NEW_STORED_IN"));
			tFaAllocatePO.setInDepartmentManager(dynaBeanMap.get("IN_DEPARTMENT_MANAGER")==null?null:(String)dynaBeanMap.get("IN_DEPARTMENT_MANAGER"));
			tFaAllocatePO.setNewWithMananger(dynaBeanMap.get("NEW_WITH_MANANGER")==null?null:(String)dynaBeanMap.get("NEW_WITH_MANANGER"));
			tFaAllocatePO.setRemark(dynaBeanMap.get("REMARK")==null?null:(String)dynaBeanMap.get("REMARK"));
			tFaAllocatePO.setUpdateDate(DateUtils.TimestampToDate(dynaBeanMap.get("UPDATE_DATE")));
			tFaAllocatePO.setUpdateBy(dynaBeanMap.get("UPDATE_BY")==null?null:(String)dynaBeanMap.get("UPDATE_BY"));
			tFaAllocatePO.setCreateDate(DateUtils.TimestampToDate(dynaBeanMap.get("CREATE_DATE")));
			tFaAllocatePO.setCreateBy(dynaBeanMap.get("CREATE_BY")==null?null:(String)dynaBeanMap.get("CREATE_BY"));
			tFaAllocatePO.setIsValid(dynaBeanMap.get("IS_VALID")==null?null:(Integer)dynaBeanMap.get("IS_VALID"));
			return tFaAllocatePO;
		}else{
			return null;
		}
	}
}
